﻿<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) Riwut Libinuko, 2010 - Ideas For Free
http://blog.libinuko.com
-->
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- download Zip document -->
  <CustomAction Id="SharePointZip.DownloadZipFile"
                Title="$Resources:ActionDownloadZipFile_Title"
                Description="$Resources:ActionDownloadZipFile_Desc"
                ImageUrl="$Resources:ActionDownloadZipFile_Icon"
                Location="EditControlBlock"
                RegistrationType="ContentType"
                RegistrationId="0x0101"
                Sequence="1000"
                >
    
    <UrlAction Url="javascript:
               function CallCompressorDialog(dialogResult, returnValue)
               {
                   	if (dialogResult == SP.UI.DialogResult.OK) {
		                   SP.UI.Notify.addNotification('Operation Completed!');
	                  }
	                  if (dialogResult == SP.UI.DialogResult.cancel) {
		                   SP.UI.Notify.addNotification('Operation Cancelled');
	                  }                   
                   SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
               }
               var baseUrl = '/_layouts/SharePointZip/Manager.aspx';
               var options = {
                  url: '{SiteUrl}' + baseUrl + '?List={ListId}&amp;ID={ItemId}&amp;Download=True',
                  title: 'SharePoint Zip - Download Manager',
                  allowMaximize: false,
                  showClose:true,
                  width:500,
                  height:300,
                  dialogReturnValueCallback:CallCompressorDialog
               };
               SP.UI.ModalDialog.showModalDialog(options);
               "
     />
  </CustomAction>
</Elements>
